﻿inherited FormPedido: TFormPedido
  Caption = 'Pedido'
  ClientHeight = 627
  ClientWidth = 794
  OnCreate = FormCreate
  OnKeyDown = FormKeyDown
  ExplicitTop = -122
  ExplicitWidth = 800
  ExplicitHeight = 655
  PixelsPerInch = 96
  TextHeight = 13
  inherited pgcMestre: TPageControl
    Width = 794
    Height = 627
    ExplicitWidth = 794
    ExplicitHeight = 627
    inherited pagPrincipal: TTabSheet
      ExplicitLeft = 4
      ExplicitTop = 24
      ExplicitWidth = 786
      ExplicitHeight = 599
      object lblId: TLabel [0]
        Left = 15
        Top = 60
        Width = 10
        Height = 13
        Caption = 'Id'
      end
      object lblDataLancamento: TLabel [1]
        Left = 210
        Top = 60
        Width = 73
        Height = 13
        Caption = 'Data do pedido'
      end
      object lblDataEntrega: TLabel [2]
        Left = 298
        Top = 60
        Width = 64
        Height = 13
        Caption = 'Data entrega'
      end
      object lblVendor: TLabel [3]
        Left = 386
        Top = 60
        Width = 46
        Height = 13
        Caption = 'Vendedor'
      end
      object lblObservacoes: TLabel [4]
        Left = 15
        Top = 484
        Width = 63
        Height = 13
        Caption = 'Observa'#231#245'es'
      end
      object lblDataRegistro: TLabel [5]
        Left = 75
        Top = 60
        Width = 63
        Height = 13
        Caption = 'Data registro'
      end
      object lbConfirmado: TLabel [6]
        Left = 696
        Top = 60
        Width = 60
        Height = 13
        Caption = 'Confirmado?'
      end
      inherited pnlBotoes: TPanel
        Width = 786
        ExplicitWidth = 786
      end
      object edtId: TDBEdit
        Left = 15
        Top = 75
        Width = 50
        Height = 21
        TabStop = False
        DataField = 'Id'
        DataSource = dtsMestre
        Enabled = False
        TabOrder = 1
      end
      object edtDataLancamento: TDBEdit
        Left = 210
        Top = 75
        Width = 80
        Height = 21
        DataField = 'DataLancamento'
        DataSource = dtsMestre
        TabOrder = 3
      end
      object edtDataEntrega: TDBEdit
        Left = 298
        Top = 75
        Width = 80
        Height = 21
        DataField = 'DataEntrega'
        DataSource = dtsMestre
        TabOrder = 4
      end
      object grbCliente: TGroupBox
        Left = 15
        Top = 105
        Width = 755
        Height = 70
        Caption = ' Cliente '
        TabOrder = 7
        object lblCliente_CNPJ_CPF: TLabel
          Left = 15
          Top = 20
          Width = 48
          Height = 13
          Caption = 'CNPJ/CPF'
        end
        object lblClienteNome: TLabel
          Left = 145
          Top = 20
          Width = 27
          Height = 13
          Caption = 'Nome'
        end
        object lblClienteNomeUsual: TLabel
          Left = 520
          Top = 20
          Width = 55
          Height = 13
          Caption = 'Nome usual'
        end
        object edtCliente_CNPJ_CPF: TDBEdit
          Left = 15
          Top = 34
          Width = 100
          Height = 21
          DataField = 'Cliente_CNPJ_CPF'
          DataSource = dtsMestre
          TabOrder = 0
          OnExit = edtCliente_CNPJ_CPFExit
        end
        object btnCliente: TButton
          Left = 115
          Top = 34
          Width = 20
          Height = 21
          Caption = '...'
          TabOrder = 1
          OnClick = btnClienteClick
        end
        object edtCliente_Nome: TDBEdit
          Left = 145
          Top = 34
          Width = 365
          Height = 21
          DataField = 'Cliente_Nome'
          DataSource = dtsMestre
          Enabled = False
          TabOrder = 2
        end
        object edtCliente_NomeUsual: TDBEdit
          Left = 520
          Top = 34
          Width = 220
          Height = 21
          DataField = 'Cliente_NomeUsual'
          DataSource = dtsMestre
          Enabled = False
          TabOrder = 3
        end
      end
      object grdItens: TGroupBox
        Left = 15
        Top = 180
        Width = 755
        Height = 298
        Anchors = [akLeft, akTop, akBottom]
        Caption = ' Itens '
        TabOrder = 8
        object GridItens: TDBGrid
          Left = 2
          Top = 105
          Width = 751
          Height = 127
          TabStop = False
          Align = alClient
          DataSource = dtsPedidoItem
          PopupMenu = pupItens
          ReadOnly = True
          TabOrder = 1
          TitleFont.Charset = DEFAULT_CHARSET
          TitleFont.Color = clWindowText
          TitleFont.Height = -11
          TitleFont.Name = 'Tahoma'
          TitleFont.Style = []
        end
        object pnlItens: TPanel
          Left = 2
          Top = 15
          Width = 751
          Height = 90
          Align = alTop
          TabOrder = 0
          object lblProdutos: TLabel
            Left = 188
            Top = 2
            Width = 38
            Height = 13
            Caption = 'Produto'
            PopupMenu = pupItens
          end
          object lblIndustriaMarca: TLabel
            Left = 17
            Top = 2
            Width = 76
            Height = 13
            Caption = 'Industria/marca'
            PopupMenu = pupItens
          end
          object lblReferencia: TLabel
            Left = 17
            Top = 42
            Width = 52
            Height = 13
            Caption = 'Refer'#234'ncia'
            PopupMenu = pupItens
          end
          object edtQuantidade: TLabeledEdit
            Left = 528
            Top = 57
            Width = 60
            Height = 21
            Ctl3D = True
            EditLabel.Width = 56
            EditLabel.Height = 13
            EditLabel.Caption = 'Quantidade'
            ParentCtl3D = False
            TabOrder = 3
          end
          object edtValor: TLabeledEdit
            Left = 595
            Top = 57
            Width = 75
            Height = 21
            Ctl3D = True
            EditLabel.Width = 24
            EditLabel.Height = 13
            EditLabel.Caption = 'Valor'
            ParentCtl3D = False
            TabOrder = 4
          end
          object btnProdutoAdicionar: TBitBtn
            Left = 681
            Top = 55
            Width = 55
            Height = 25
            Caption = 'Incluir'
            Glyph.Data = {
              36050000424D3605000000000000360400002800000010000000100000000100
              08000000000000010000C40E0000C40E00000001000000000000000000000000
              80000080000000808000800000008000800080800000C0C0C000C0DCC000F0CA
              A6000020400000206000002080000020A0000020C0000020E000004000000040
              20000040400000406000004080000040A0000040C0000040E000006000000060
              20000060400000606000006080000060A0000060C0000060E000008000000080
              20000080400000806000008080000080A0000080C0000080E00000A0000000A0
              200000A0400000A0600000A0800000A0A00000A0C00000A0E00000C0000000C0
              200000C0400000C0600000C0800000C0A00000C0C00000C0E00000E0000000E0
              200000E0400000E0600000E0800000E0A00000E0C00000E0E000400000004000
              20004000400040006000400080004000A0004000C0004000E000402000004020
              20004020400040206000402080004020A0004020C0004020E000404000004040
              20004040400040406000404080004040A0004040C0004040E000406000004060
              20004060400040606000406080004060A0004060C0004060E000408000004080
              20004080400040806000408080004080A0004080C0004080E00040A0000040A0
              200040A0400040A0600040A0800040A0A00040A0C00040A0E00040C0000040C0
              200040C0400040C0600040C0800040C0A00040C0C00040C0E00040E0000040E0
              200040E0400040E0600040E0800040E0A00040E0C00040E0E000800000008000
              20008000400080006000800080008000A0008000C0008000E000802000008020
              20008020400080206000802080008020A0008020C0008020E000804000008040
              20008040400080406000804080008040A0008040C0008040E000806000008060
              20008060400080606000806080008060A0008060C0008060E000808000008080
              20008080400080806000808080008080A0008080C0008080E00080A0000080A0
              200080A0400080A0600080A0800080A0A00080A0C00080A0E00080C0000080C0
              200080C0400080C0600080C0800080C0A00080C0C00080C0E00080E0000080E0
              200080E0400080E0600080E0800080E0A00080E0C00080E0E000C0000000C000
              2000C0004000C0006000C0008000C000A000C000C000C000E000C0200000C020
              2000C0204000C0206000C0208000C020A000C020C000C020E000C0400000C040
              2000C0404000C0406000C0408000C040A000C040C000C040E000C0600000C060
              2000C0604000C0606000C0608000C060A000C060C000C060E000C0800000C080
              2000C0804000C0806000C0808000C080A000C080C000C080E000C0A00000C0A0
              2000C0A04000C0A06000C0A08000C0A0A000C0A0C000C0A0E000C0C00000C0C0
              2000C0C04000C0C06000C0C08000C0C0A000F0FBFF00A4A0A000808080000000
              FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFFFFFFFFFE3
              D9DADADAEBFFFFFFFFFFFFFFFFFFFFD909EAEAEADAFFFFFFFFFFFFFFFFFFFFD9
              09EAE2EADAFFFFFFFFFFFFFFFFFFFFD909E2E2EADAFFFFFFFFFFFFFFFFFFFFD9
              09E2E2EADAFFFFFFFFFFE3D9D9D9D9D909E2E2EADADADADADAE2D909EBE2E2E2
              EAE2E2EAEAEAEAEAEADAD909E2E2E2E2E2E2E2E2E2E2E2E2EADAD909E3E2E2E2
              E2E2E2E2EBEBEBEBEBDAD9090909090909E3E2EB0909090909D9E3D9D9D9D9D9
              09E2E2E2D9D9D9D9D9ECFFFFFFFFFFD909E2E2E2D9FFFFFFFFFFFFFFFFFFFFD9
              09E2E2E2D9FFFFFFFFFFFFFFFFFFFFD909E3E2EBD9FFFFFFFFFFFFFFFFFFFFD9
              09090909D9FFFFFFFFFFFFFFFFFFFFE3D9D9D9D9E3FFFFFFFFFF}
            TabOrder = 5
            OnClick = btnProdutoAdicionarClick
          end
          object edtProduto: TDBLookupComboBox
            Left = 188
            Top = 17
            Width = 160
            Height = 21
            KeyField = 'Id'
            ListField = 'Descricao'
            ListSource = dtsProduto
            TabOrder = 0
          end
          object edtIndustriaMarca: TDBLookupComboBox
            Left = 17
            Top = 17
            Width = 160
            Height = 21
            KeyField = 'Id'
            ListField = 'Descricao'
            ListSource = dtsIndustriaMarca
            TabOrder = 1
            OnClick = edtIndustriaMarcaClick
          end
          object edtReferencia: TDBLookupComboBox
            Left = 17
            Top = 57
            Width = 504
            Height = 21
            KeyField = 'Id'
            ListField = 'RefDescricao'
            ListSource = dtsReferencia
            TabOrder = 2
          end
        end
        object pnlItensTotal: TPanel
          Left = 2
          Top = 232
          Width = 751
          Height = 64
          Align = alBottom
          Alignment = taLeftJustify
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clWindowText
          Font.Height = -11
          Font.Name = 'Tahoma'
          Font.Style = [fsBold]
          ParentFont = False
          TabOrder = 2
          object lblTotalPedido: TLabel
            Left = 560
            Top = 35
            Width = 70
            Height = 13
            Caption = 'Total pedido'
          end
          object lblTotalValorComissao: TLabel
            Left = 550
            Top = 10
            Width = 79
            Height = 13
            Caption = 'Comiss'#227'o(R$)'
          end
          object lblTotalComissao: TLabel
            Left = 355
            Top = 10
            Width = 77
            Height = 13
            Caption = 'Comiss'#227'o(%)'
          end
          object Label1: TLabel
            Left = 355
            Top = 35
            Width = 78
            Height = 13
            Caption = 'Desconto(R$)'
          end
          object edtTotalPedido: TDBEdit
            Left = 635
            Top = 32
            Width = 100
            Height = 21
            DataField = 'TotalPedido'
            DataSource = dtsMestre
            TabOrder = 0
          end
          object edtTotalValorComissao: TDBEdit
            Left = 635
            Top = 7
            Width = 100
            Height = 21
            DataField = 'TotalValorComissao'
            DataSource = dtsMestre
            TabOrder = 1
          end
          object edtTotalComissao: TDBEdit
            Left = 440
            Top = 7
            Width = 100
            Height = 21
            DataField = 'TotalComissao'
            DataSource = dtsMestre
            TabOrder = 2
          end
          object edtDesconto: TDBEdit
            Left = 440
            Top = 32
            Width = 100
            Height = 21
            DataField = 'Desconto'
            DataSource = dtsMestre
            TabOrder = 3
          end
        end
      end
      object edtObservação: TDBMemo
        Left = 15
        Top = 504
        Width = 755
        Height = 50
        DataField = 'Observacao'
        DataSource = dtsMestre
        ScrollBars = ssVertical
        TabOrder = 9
      end
      object edtVendedor: TDBLookupComboBox
        Left = 386
        Top = 75
        Width = 301
        Height = 21
        DataField = 'Vendedor_Id'
        DataSource = dtsMestre
        KeyField = 'Id'
        ListField = 'NomeUsual'
        ListSource = dtsVendedor
        TabOrder = 5
      end
      object edtDataRegristro: TDBEdit
        Left = 75
        Top = 75
        Width = 125
        Height = 21
        TabStop = False
        DataField = 'DataRegistro'
        DataSource = dtsMestre
        Enabled = False
        TabOrder = 2
      end
      object pnlBottom: TPanel
        Left = 0
        Top = 565
        Width = 786
        Height = 34
        Align = alBottom
        Color = clGradientActiveCaption
        ParentBackground = False
        TabOrder = 10
        object lbAtalho: TLabel
          Left = 11
          Top = 12
          Width = 249
          Height = 13
          Caption = 'F5 - Localizar cliente | F9 - Confirmar pedido'
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clWindowText
          Font.Height = -11
          Font.Name = 'Tahoma'
          Font.Style = [fsBold]
          ParentFont = False
        end
      end
      object edtConfirmado: TDBEdit
        Left = 696
        Top = 75
        Width = 72
        Height = 21
        TabStop = False
        DataField = 'Confirmado'
        DataSource = dtsMestre
        ReadOnly = True
        TabOrder = 6
      end
    end
    object tbGerar: TTabSheet
      Caption = 'Gerar O.S'
      ImageIndex = 1
      OnShow = tbGerarShow
      object Panel1: TPanel
        Left = 0
        Top = 0
        Width = 786
        Height = 50
        Align = alTop
        TabOrder = 0
        object btnGerarOS: TBitBtn
          Left = 1
          Top = 1
          Width = 75
          Height = 48
          Align = alLeft
          Caption = 'Gerar O.S'
          TabOrder = 0
          OnClick = btnGerarOSClick
        end
      end
      object GridOSItens: TEuDBGrid
        Left = 0
        Top = 50
        Width = 786
        Height = 514
        Align = alClient
        DataSource = dtsOSItens
        TabOrder = 1
        TitleFont.Charset = DEFAULT_CHARSET
        TitleFont.Color = clWindowText
        TitleFont.Height = -11
        TitleFont.Name = 'Tahoma'
        TitleFont.Style = []
        ButtonShortCut = 32808
        CurrentRowColor = clSkyBlue
        OnLayoutChanged = GridOSItensLayoutChanged
      end
      object Panel2: TPanel
        Left = 0
        Top = 564
        Width = 786
        Height = 35
        Align = alBottom
        Alignment = taLeftJustify
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -11
        Font.Name = 'Tahoma'
        Font.Style = [fsBold]
        ParentFont = False
        TabOrder = 2
      end
    end
  end
  inherited dtsMestre: TDataSource
    Left = 470
    Top = 25
  end
  inherited actAcoes: TActionList
    Left = 634
    Top = 25
    inherited actPesquisar: TAction
      OnExecute = actPesquisarExecute
    end
  end
  inherited cdsMestre: TClientDataSet
    Params = <
      item
        DataType = ftInteger
        Name = 'ID'
        ParamType = ptInput
      end>
    AfterOpen = cdsMestreAfterOpen
    AfterInsert = cdsMestreAfterInsert
    BeforeEdit = cdsMestreBeforeEdit
    BeforePost = cdsMestreBeforePost
    BeforeDelete = cdsMestreBeforeDelete
    OnReconcileError = cdsMestreReconcileError
    Left = 525
    Top = 25
    object cdsMestreId: TAutoIncField
      FieldName = 'Id'
      ReadOnly = True
    end
    object cdsMestreDataRegistro: TDateTimeField
      FieldName = 'DataRegistro'
      Required = True
    end
    object cdsMestreDataLancamento: TDateField
      FieldName = 'DataLancamento'
      Required = True
    end
    object cdsMestreDataEntrega: TDateField
      FieldName = 'DataEntrega'
    end
    object cdsMestreVendedor_Id: TIntegerField
      FieldName = 'Vendedor_Id'
      Required = True
    end
    object cdsMestreConfirmado: TBooleanField
      FieldName = 'Confirmado'
      OnGetText = cdsMestreConfirmadoGetText
    end
    object cdsMestreVendedor_Nome: TStringField
      FieldName = 'Vendedor_Nome'
      ReadOnly = True
      Size = 80
    end
    object cdsMestreCliente_Id: TIntegerField
      FieldName = 'Cliente_Id'
      Required = True
    end
    object cdsMestreCliente_CNPJ_CPF: TStringField
      FieldName = 'Cliente_CNPJ_CPF'
      ReadOnly = True
      Size = 18
    end
    object cdsMestreCliente_Nome: TStringField
      FieldName = 'Cliente_Nome'
      ReadOnly = True
      Size = 80
    end
    object cdsMestreCliente_NomeUsual: TStringField
      FieldName = 'Cliente_NomeUsual'
      ReadOnly = True
      Size = 50
    end
    object cdsMestreObservacao: TMemoField
      FieldName = 'Observacao'
      BlobType = ftMemo
    end
    object cdsMestreTotalPedido: TFloatField
      FieldName = 'TotalPedido'
      ReadOnly = True
    end
    object cdsMestreTotalValorComissao: TFloatField
      FieldName = 'TotalValorComissao'
      ReadOnly = True
    end
    object cdsMestreTotalComissao: TFloatField
      FieldName = 'TotalComissao'
      ReadOnly = True
    end
    object cdsMestrepId: TLargeintField
      FieldName = 'pId'
      ReadOnly = True
    end
    object cdsMestreQPedidoItem: TDataSetField
      FieldName = 'QPedidoItem'
    end
    object cdsMestreDesconto: TFloatField
      FieldName = 'Desconto'
      currency = True
    end
  end
  inherited dspMestre: TDataSetProvider
    DataSet = DM.QPedido
    Left = 582
    Top = 25
  end
  object cdsPedidoItem: TClientDataSet
    Aggregates = <>
    DataSetField = cdsMestreQPedidoItem
    Params = <>
    AfterOpen = cdsPedidoItemAfterOpen
    BeforeInsert = cdsPedidoItemBeforeInsert
    BeforeEdit = cdsPedidoItemBeforeEdit
    BeforeDelete = cdsPedidoItemBeforeDelete
    OnReconcileError = cdsPedidoItemReconcileError
    Left = 249
    Top = 374
    object cdsPedidoItemId: TAutoIncField
      FieldName = 'Id'
      Origin = 'Id'
      ProviderFlags = [pfInWhere, pfInKey]
      ReadOnly = True
    end
    object cdsPedidoItemPedido_Id: TIntegerField
      FieldName = 'Pedido_Id'
      Origin = 'Pedido_Id'
      Required = True
    end
    object cdsPedidoItemProdutoReferencia_Id: TIntegerField
      FieldName = 'ProdutoReferencia_Id'
      Origin = 'ProdutoReferencia_Id'
      Required = True
    end
    object cdsPedidoItemProduto_Codigo: TIntegerField
      FieldName = 'Produto_Codigo'
      Origin = 'Codigo'
      ProviderFlags = []
      ReadOnly = True
    end
    object cdsPedidoItemProduto_Descricao: TStringField
      FieldName = 'Produto_Descricao'
      Origin = 'Descricao'
      ProviderFlags = []
      ReadOnly = True
      Size = 60
    end
    object cdsPedidoItemIndustriaMarca_Descricao: TStringField
      FieldName = 'IndustriaMarca_Descricao'
      Origin = 'Descricao'
      ProviderFlags = []
      ReadOnly = True
      Size = 50
    end
    object cdsPedidoItemProdutoReferencia_Referencia: TIntegerField
      FieldName = 'ProdutoReferencia_Referencia'
      Origin = 'Referencia'
      ProviderFlags = []
      ReadOnly = True
    end
    object cdsPedidoItemProdutoReferencia_Descricao: TStringField
      FieldName = 'ProdutoReferencia_Descricao'
      Origin = 'Descricao'
      ProviderFlags = []
      ReadOnly = True
      Size = 60
    end
    object cdsPedidoItemQuantidade: TIntegerField
      FieldName = 'Quantidade'
      Origin = 'Quantidade'
    end
    object cdsPedidoItemValorUn: TFloatField
      FieldName = 'ValorUn'
      Origin = 'ValorUn'
    end
    object cdsPedidoItemTotalProduto: TFloatField
      FieldName = 'TotalProduto'
      Origin = 'TotalProduto'
      ProviderFlags = []
      ReadOnly = True
    end
    object cdsPedidoItemComissao: TFloatField
      FieldName = 'Comissao'
      Origin = 'Comissao'
    end
    object cdsPedidoItemValorComissao: TFloatField
      FieldName = 'ValorComissao'
      Origin = 'ValorComissao'
      ProviderFlags = []
      ReadOnly = True
    end
    object cdsPedidoItempId: TLargeintField
      FieldName = 'pId'
      Origin = 'pId'
      ProviderFlags = []
      ReadOnly = True
    end
  end
  object dtsPedidoItem: TDataSource
    DataSet = cdsPedidoItem
    Left = 324
    Top = 374
  end
  object pupItens: TPopupMenu
    Left = 394
    Top = 374
    object mniAlterar: TMenuItem
      Caption = 'Alterar'
      Enabled = False
    end
    object mniAlterarComissao: TMenuItem
      Caption = 'Alterar comiss'#227'o'
      OnClick = mniAlterarComissaoClick
    end
    object mniExcluir: TMenuItem
      Caption = 'Excluir'
      OnClick = mniExcluirClick
    end
  end
  object QProduto: TFDQuery
    Connection = DM.FDConexao
    SQL.Strings = (
      'SELECT '
      '  Produto.Id, '
      '  Produto.Codigo, '
      '  Produto.Descricao, '
      '  Produto.Comissao '
      'FROM Produto'
      
        'LEFT JOIN ProdutoIndustria ON ProdutoIndustria.Produto_Id = Prod' +
        'uto.Id'
      
        'LEFT JOIN IndustriaMarca ON IndustriaMarca.Id = ProdutoIndustria' +
        '.IndustriaMarca_Id '
      'WHERE IndustriaMarca.Id = :IndustriaMarca'
      '  ORDER BY Produto.Descricao')
    Left = 50
    Top = 280
    ParamData = <
      item
        Name = 'INDUSTRIAMARCA'
        DataType = ftInteger
        ParamType = ptInput
        Value = Null
      end>
  end
  object dtsProduto: TDataSource
    DataSet = QProduto
    OnDataChange = dtsProdutoDataChange
    Left = 110
    Top = 280
  end
  object QIndustriaMarca: TFDQuery
    Connection = DM.FDConexao
    SQL.Strings = (
      'SELECT '
      '  Id, '
      '  Descricao '
      'FROM IndustriaMarca '
      'ORDER BY Descricao')
    Left = 225
    Top = 280
  end
  object dtsIndustriaMarca: TDataSource
    DataSet = QIndustriaMarca
    OnDataChange = dtsIndustriaMarcaDataChange
    Left = 310
    Top = 280
  end
  object QReferencia: TFDQuery
    Connection = DM.FDConexao
    SQL.Strings = (
      'SELECT'
      '  ProdutoReferencia.Id,'
      '  ProdutoReferencia.Referencia,'
      '  ProdutoReferencia.Descricao,'
      
        '  CONCAT(ProdutoReferencia.Descricao, " - ", IFNULL(ProdutoRefer' +
        'encia.Referencia, "")) AS RefDescricao,'
      '  ProdutoReferencia.PVenda'
      'FROM '
      '  ProdutoReferencia'
      
        '  JOIN ProdutoIndustria ON ProdutoIndustria.Id = ProdutoReferenc' +
        'ia.ProdutoIndustria_Id'
      'WHERE'
      '  ProdutoIndustria.Produto_Id = :Produto_Id AND'
      '  ProdutoIndustria.IndustriaMarca_Id = :IndustriaMarca_Id'
      'ORDER BY ProdutoReferencia.Descricao')
    Left = 410
    Top = 280
    ParamData = <
      item
        Name = 'PRODUTO_ID'
        DataType = ftInteger
        ParamType = ptInput
        Value = Null
      end
      item
        Name = 'INDUSTRIAMARCA_ID'
        DataType = ftInteger
        ParamType = ptInput
        Value = Null
      end>
  end
  object dtsReferencia: TDataSource
    DataSet = QReferencia
    OnDataChange = dtsReferenciaDataChange
    Left = 480
    Top = 280
  end
  object QVendedor: TFDQuery
    Connection = DM.FDConexao
    SQL.Strings = (
      'SELECT'
      '  Pessoa.Id,'
      '  Pessoa.NomeUsual'
      'FROM'
      '  Pessoa'
      'WHERE '
      '  Pessoa.Vendedor = "T"'
      'ORDER By '
      '  Pessoa.NomeUsual  ')
    Left = 650
    Top = 120
  end
  object dtsVendedor: TDataSource
    DataSet = QVendedor
    Left = 710
    Top = 120
  end
  object cdsOSItens: TClientDataSet
    Aggregates = <>
    Params = <>
    AfterOpen = cdsOSItensAfterOpen
    BeforeInsert = cdsOSItensBeforeInsert
    AfterPost = cdsOSItensAfterPost
    Left = 108
    Top = 32
  end
  object dtsOSItens: TDataSource
    DataSet = cdsOSItens
    Left = 180
    Top = 32
  end
end
